package com.samphanie.auiu.biz_home.api

import com.samphanie.auiu.common.http.ApiFactory
import com.samphanie.auiu.library.restful.AuiuCall
import com.samphanie.auiu.library.restful.annotation.Get
import com.samphanie.auiu.library.restful.annotation.Path
import com.samphanie.auiu.biz_home.model.SubCategory
import com.samphanie.auiu.biz_home.model.TabCategory

/**
 * @author ZSY
 */
interface CategoryApi {

    @Get("/auiu-app/v1/open_api/home/category/tabs")
    fun queryCategoryList() : AuiuCall<List<TabCategory>>

    @Get("/auiu-app/v1/open_api/home/category/{cateId}/list")
    fun querySubCategoryList(@Path("cateId") cateId: String) : AuiuCall<List<SubCategory>>

    companion object {
        fun create(): CategoryApi {
            return ApiFactory.create(CategoryApi::class.java)
        }
    }
}

fun categoryApiService(): CategoryApi {
    return CategoryApi.create()
}